home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Pocket 6.3 / Documents / Glossary next >
Text File  |  1993-06-12  |  32KB  |  424 lines

  1. Pocket Forth Glossary  version 0.6.3
  2.  
  3. ! ( n addr -- ) say: "store"  <standard>   Store value n at the relative address, addr.
  4.  
  5. !PEN ( h v -- ) say: "store pen"   Move the graphics pen to the coordinates on the stack.
  6.  
  7. # ( dval -- dquotient ) say: "sharp"  <standard>   Convert one digit of a numeral represented by the dvalue, by dividing the value by the numeric base.  Use between "greater-than-sharp" and "sharp-less-than".
  8.  
  9. #> ( dval -- addr len ) say: "sharp-less-than"  <standard>   Leave the address and length of a string representing the formatted dvalue.  Use with #, "sharps", "sharp", "hold" and "greater-than-sharp".
  10.  
  11. #S ( dval -- 0 0 ) say: "sharps"  <standard>   Convert all of the digits of the dvalue according to the current numeric base.  Use between "greater-than-sharp" and "sharp-less-than".
  12.  
  13. ' ( -- addr ) say: "tick"  <standard>   Return the relative address of the next word from the input stream.
  14.  
  15. ( ( -- ) say: "parenthesis"  <standard>   Begin a comment.  A right parenthesis ends the comment.
  16.  
  17. (DO) ( limit index -- ) say: "paren-do" <standard>   This is the runtime word compiled into the dictionary by "do". "Paren-do" begins a loop.
  18.  
  19. * ( n1 n2 -- n1*n2 ) say: "star" or "times" <standard>   Multiply n1 by n2, and leave the 16 bit result on the stack.
  20.  
  21. */ ( n1 n2 n3 -- [n1*n2]/n3 ) say: "star-slash" <standard>   Using a 32 bit intermediate, "star-slash" puts the scaled result on the stack.
  22.  
  23. + ( n1 n2 -- n1+n2) say: "plus" <standard>   Leave the result of n1 plus n2 on the stack.
  24.  
  25. +! ( n addr -- ) say: "plus-store" <standard>   Add the value, n, to the value found at the relative address, addr.
  26.  
  27. +LOOP ( n -- ) say: "plus-loop" <standard>   Used inside of a colon definition, with "do".  Increment a loop index by n, and branch to the beginning of the loop until the index reaches the limit.  (see "loop" and "do")
  28.  
  29. +MD ( offset -- addr ) say: "plus-em-dee"   Calculate the relative address of an unnamed variable from an offset on the stack.
  30.  
  31. , ( n -- ) say: "comma" <standard>   Write and enclose the value, 'n' into the dictionary.
  32.  
  33. ,s ( -- d ) say: "comma-ess"  Stack or compile a double number literal from ASCII characters which follow ,s by exactly one space.  ,S is immediate.
  34.  
  35. ,$ ( -- ) say: "comma-dollar"   Compile a hex number from the input stream into the dictionary.   Used to compile traps and machine code.  ,$ is immediate.
  36.  
  37. - ( n1 n2 -- n1-n2 ) say: "minus" <standard>   Leave n1 minus n2 on the stack.
  38.  
  39. --> ( -- ) say: "load"  <almost standard>   Take a filename from the input stream, and load the file from the disk.  If no disk or path is specified, the default is used.  NOTE: Names may not contain spaces.
  40.  
  41. -TO ( h v -- ) say: "line to" Draw a line and move the pen to the coordinates on the stack.
  42.  
  43. -TRAILING ( addr count -- addr count' ) say: "dash-trailing" <standard>   Assuming string data on the stack, adjust the count to eliminate trailing blanks.
  44.  
  45. . ( n -- ) say: "dot" <standard>   Print the value on the stack according to the current number base.   (see "base")
  46.  
  47. ." ( -- ) say: "dot-quote" <standard>   Used inside of a colon definition to compile a routine and string data into the dictionary.  The string data follows "dot-quote" and is delimited by another quote. The string is printed at runtime.
  48.  
  49. .OK ( -- ) say: "dot-oh-kay"   Print 'ok' on the screen, indicating that the interpreter ready for input.
  50.  
  51. / ( n1 n2 -- quotient ) say: "slash" <standard>   Divide n1 by n2 and leave the 16 bit quotient on the stack.
  52.  
  53. /MOD ( n1 n2 -- quotient remainder ) say: "slash-mod" <standard>   Divide n1 by n2 and leave the 16 bit quotient and 16 bit remainder on the stack.
  54.  
  55. 0  ( -- 0 ) say: "zero" <standard>  Leave a zero on the stack.
  56.  
  57. 0< ( n -- flag ) say: "zero-less-than" <standard>   Leave a negative one on the stack if n is less than zero. Otherwise leave a zero.
  58.  
  59. 0= ( n -- flag ) say: "zero-equal" <standard>   Leave a true flag on the stack if n is zero.  Otherwise leave a zero on the stack.
  60.  
  61. 0> ( n -- flag ) say: "zero-more-than" or "zero-greater-than"  <standard>   Leave a true flag on the stack if n is greater than zero.  Otherwise leave a zero.
  62.  
  63. 1+ ( n -- n+1 ) say: "one-plus"  <standard>   Add one to the value, n on the stack.  Leave the result on the stack.
  64.  
  65. 1- ( n -- n-1 ) say: "one-minus"  <standard>   Subtract one from the value on the stack.  Leave the result on the stack.
  66.  
  67. 2! ( d addr -- ) say: "two-store"  <standard>   Store the 32 bit number, d, at the relative address, addr.
  68.  
  69. 2+ ( n -- n+2 ) say: "two-plus"  <standard>   Add two to the value on the stack, leaving the result on the stack.
  70.  
  71. 2* ( n -- n*2 ) say: "two-star" or "two-times"  <standard>   Double the value on the stack.
  72.  
  73. 2/ ( n -- n/2 ) say: "two-slash" <standard>   Halve the value on the stack, truncating to an integer.
  74.  
  75. 2>R ( d -- ) ( rstack: -- d ) say: "two to are"   Put a 32 bit number on the return stack.  Use within colon definitions.
  76.  
  77. 2@ ( addr -- d ) say:  "two at"  <standard>   Fetch a 32 bit number from relative address on the stack.
  78.  
  79. 2CONSTANT ( compile: [ d -- ] run: [ -- d ] ) <standard>   Create a 32 bit constant.
  80.  
  81. 2DROP ( d1 -- ) say: "two drop" <standard>   Drop a 32 bit number.
  82.  
  83. 2DUP ( n1 n2 -- n1 n2 n1 n2 ) say: "two-dupe" <standard>   Duplicate the top two values on the stack.
  84.  
  85. 2OVER ( d1 d2 -- d1 d2 d1 ) say: "two-over" <standard>   Duplicate the 32 bit second number to the top of the stack.
  86.  
  87. 2R> ( -- d ) ( rstack: d -- ) say: "two-are-from"   Move a 32 bit number from the return stack to the parameter stack.
  88.  
  89. 2ROT ( d1 d2 d3 -- d2 d3 d1 ) say: "two-rote" <standard>  Rotate the top three 32 bit numbers.
  90.  
  91. 2SWAP ( n1 n2 n3 n4 -- n3 n4 n1 n2 ) say: "two-swap" <standard>   Reverse the order of the top two and the second two values on the stack.
  92.  
  93. 2VARIABLE ( compile: [ -- ] run: [ -- addr ] )  <standard>   Create a 32 bit variable.  See change to "variable", below.
  94.  
  95. : ( -- ) say: "colon" <standard> "Colon" creates a new word, called a colon definition.  The token following "colon" is the name of the new word.  Non-immediate words following the name are compiled into the definition until a "semi-colon" is reached.
  96.  
  97. ; ( -- ) say: "semi-colon" <standard>  "Semi-colon" ends a colon definition and compiles a machine language return instruction. "Semi-colon" is immediate.
  98.  
  99. ;AE ( -- ) say "semi-a-e  Use "semi-a-e" to end an Apple Event definition. Pocket Forth's registers are saved and the calling registers are restored. "Semi-a-e" is an immediate word.
  100.  
  101. < ( n1 n2 -- flag ) say: "less-than" <standard>   Leave a true flag on the stack if n1 is less than n2.  Otherwise leave a zero.
  102.  
  103. <# ( -- ) say: "greater-than-sharp"  <standard>   Set up for number conversion by clearing the pad, and setting 'held' to "pad"-1.
  104.  
  105. = ( n1 n2 -- flag ) say: "equal" <standard>   Leave a true flag on the stack if n1 is the same as n2.  Otherwise leave a zero.
  106.  
  107. > ( n1 n2 -- flag ) say: "greater-than" <standard>   Leave a true flag on the stack if n1 is more than n2. Otherwise leave a zero.
  108.  
  109. >ABS ( addr16 -- daddr32 ) say: "to-abs"   Convert a relative address on the stack to a double number absolute address.   (see ">rel")
  110.  
  111. >LINK ( addr -- link.addr ) say: "to-link"  <standard>   Return the relative address of the link field of the word whose address is on the stack.
  112.  
  113. >NAME ( addr -- name.addr ) say: "to-name"  <standard>   Leave the relative address of the name field of the word whose address is on the stack.
  114.  
  115. >R ( n -- ) return stack: ( -- n ) say: "to-are" <standard>   Remove a value from the parameter stack and place it on the return stack.   (see "are-from")
  116.  
  117. >REL ( daddr32 -- addr16 ) say: "to-rel"   Convert a double number absolute address on the stack to a relative address.
  118.  
  119. ?BUTTON ( -- flag ) say: "question-button"   The flag is true if the mouse button is down, false if up.
  120.  
  121. ?DUP ( n -- n n OR n [if n=0] ) say: "question-dupe" <standard>   Duplicate the value on the stack only if it is not zero.
  122.  
  123. ?GESTALT ( d.selector -- d.response -1  or  0 ) say: "question-gestalt"  Run the system trap _Gestalt on the stacked double number.  If _Gestalt does not exist or if it exits with an error, a false flag (that is, a zero) is left on the stack.  If the call is successful, a true flag (-1) is left on the stack on top of the double number result.  Use "question-gestalt" to test computer in use.
  124.  
  125. ?STACK ( ? -- ) say: "question-stack"   Print a warning, '*?', if stack underflow has occurred.
  126.  
  127. ?TERMINAL ( -- flag ) say: "question-terminal" <standard> Leave a true flag if a key has been pressed.  In the application, events are handled by "?terminal".
  128.  
  129. @ ( addr -- n ) say: "at" (some people say: "fetch") <standard>   Leave the value found at the relative address on the stack.  The address must be even.
  130.  
  131. @MOUSE  ( -- h v ) say: "at-mouse"   Get the coordinates of the mouse pointer.
  132.  
  133. @PEN ( -- h v ) say: "at-pen"   Get the coordinates of the graphics pen pen.
  134.  
  135. A>R ( addr -- : -- dabs.addr ) say: "a-to-are"   Convert an address to absolute, and put it on the return stack. This word is used for system trap setup.  Use only within a colon definition.
  136.  
  137. ABORT ( -- )  <standard>   Stop execution, print a warning, '?' and return to the interpreter loop.
  138.  
  139. AE: ( d.type d.class -- ) say: "a-e-colon"  "Ae:" begins the definition of an Apple Event handler. D.type and d.class are the type and class signatures of the event to be handled. Follow the definition with ";ae".
  140.  
  141. AGAIN  while compiling: ( addr -- )  while executing: ( -- )  <standard>   Used to compile an unconditional branch to a relative address left by "begin".  (see "begin" and "back")  "Again" is an immediate word.
  142.  
  143. ALLOT ( n -- )  <standard>   Allocate and enclose n bytes in the dictionary.  If n is odd, n+1 bytes will be allocated.  The value of the bytes is undefined at compile time.
  144.  
  145. AND ( n1 n2 -- n1ANDn2 )  <standard>   Leave the result of n1 AND n2 on the stack.  The value is computed bitwise.
  146.  
  147. BACK while compiling: ( addr -- )  no execution behavior  <standard>   Compiles the difference between the current compilation address and the address on the stack.  "Back" is used by "again", "repeat" and "until". (also see "begin" and "while")
  148.  
  149. BASE ( -- addr )  <standard>   "Base" leaves the address of a variable containing the current number base.
  150.  
  151. BEEP ( -- )   Causes the speaker to beep at the current volume.
  152.  
  153. BEGIN ( -- )  <standard>   "Begin" starts a conditional or unconditional loop in the following manner:
  154.           BEGIN … ( -- flag ) WHILE … REPEAT,
  155.           BEGIN … ( -- flag ) UNTIL and
  156.              BEGIN … AGAIN
  157.         "Begin" is an immediate word and is used within a colon definition.  (see "while", "again", "repeat" and "until")
  158.  
  159. BYE ( -- )  "Bye" sets a variable (194 +md) that causes Pocket Forth to quit on the next trip through the event loop.
  160.  
  161. C! ( c addr -- ) say: "sea-store"  <standard>   Store the 8 bit value at the relative address (even or odd).
  162.  
  163. C@ ( addr -- c ) say: "sea-at"  <standard>   Retrieve the 8 bit value found at the address (even or odd) to the stack.
  164.  
  165. CBLK ( -- addr ) say: "sea-bee-el-kay"   Returns a relative address which contains a byte value.  If the value is 128, then the interpreter looks for input from the keyboard.  A zero value causes text to be interpreted from the file stack.
  166.  
  167. CMOVE ( addr1 addr2 n -- ) say: "sea-move" <standard>   Moves n bytes from addr1 to addr2.
  168.  
  169. COMPILE ( addr -- )   "Compile" writes a subroutine call to the relative address on the stack into the dictionary. This is not identical to Forth's standard COMPILE which takes its argument from the input stream.
  170.  
  171. CONSTANT while compiling: ( n -- )  while executing: ( -- n )  <standard>   Creates a word from the next token in the input stream, which, when executed, returns the value, n.
  172.  
  173. COUNT ( addr -- addr+1 length )  <standard>   Assuming that the relative address on the stack is the start of string data, and the byte found at addr is the strings length, the address of the start of the string characters and the string length are left on the stack.
  174.  
  175. CR ( -- ) say: "sea-are"  <standard>   "Cr" advances the cursor to the next line.  Do not confuse this word with "{cr}".
  176.  
  177. CREATE while compiling: ( -- ) while executing: ( -- addr )  <standard>   Create builds a word from the next token in the input stream.  When the new word is executed, it returns the relative address of the cell following the words entry.
  178.  
  179. CSTATE ( -- addr ) say: "sea-state"   Returns the relative address of a byte which is zero if the interpreter is not in 'compiling' mode and 128 if it is.
  180.  
  181. D+ ( n1 n2  n3 n4 -- n1+n3 n2+n4 ) say: "dee-plus"  <standard>   Adds the top two double numbers and leaves the double number sum on the stack.
  182.  
  183. D. ( d -- ) say: "dee-dot"  <standard>   Print the dvalue on the stack according to the current number base.
  184.  
  185. D>F ( d -- f ) <floating> say: "dee-to-eff" Convert a double number on the stack to a floating point number.
  186.  
  187. DABS ( dval -- |dval| ) say: "dabs"  <standard>   Return the absolute value of the dvalue on the top of the stack.
  188.  
  189. DECIMAL ( -- )  <standard>   Sets the current number base to ten.
  190.  
  191. DEPTH ( -- n )  <standard> Return the number of 16 bit entries on the stack.
  192.  
  193. DL! ( n1 n2 daddr32 -- ) say: "dee-el-store"   Store a 32 bit value at an absolute 32 bit address.
  194.  
  195. DL@ ( daddr32 -- n1 n2 ) say: "dee-el-at"   Get the 32 bit value from the 32 bit absolute address on the stack.
  196.  
  197. DLITERAL  compiling: ( d -- )  executing: ( -- d )  <standard>   "Dliteral" compiles a double number from the stack. When a word containing a dliteral is executed, the number is pushed to the stack.
  198.  
  199. DNEGATE ( d -- -d ) say: "dee-negate"  <standard>  Negate the 32 bit value on the stack.
  200.  
  201. DO ( -- )  <standard>   Compile the word "paren-do" to begin an indexed loop.  The 16 bit index is kept on the return stack, and can be accessed with r.  Use with "loop" or "+loop". "Do" is an immediate word to be used within a colon definition.  (see "paren-do", "loop" and "+loop")
  202.  
  203. DOES>  while compiling: ( -- ) while executing: ( addr -- ) say: "does"  <standard>  "Does>" is used in the definition of a defining word, following "create" to define the run-time behavior of the defined word.
  204.  
  205. DROP ( n1 n2 -- n1 )  <standard>   Remove the value on the top of the stack.
  206.  
  207. DUP ( n -- n n ) say: "dupe"  <standard>   Duplicate the value on the top of the stack.
  208.  
  209. ELSE while compiling: ( addr -- addr )  while executing: ( -- )  <standard>   Used optionally between "if" and "then" in a conditional forward branch.  "Else" is an immediate word and is used within a colon definition.
  210.  
  211. EMIT ( c -- )  <standard>   Print the ASCII character represented by the value of a number on the stack.
  212.  
  213. EXECUTE ( addr -- )  <standard>   "Execute" causes the routine whose relative address is on the stack to happen.
  214.  
  215. EXIT ( -- )  <standard>   "Exit" drops an absolute address from the return stack and executes a machine language return instruction, terminating the current routine.
  216.  
  217. EXPECT ( addr count -- )  <standard>   Waits for 'count' number of characters to be typed, storing the characters, in order, at the relative address, addr.  If more characters are typed, they are echoed to the screen, but not saved. A blank character and a zero byte are appended to the characters.  Events are handled normally during "expect".
  218.  
  219. F! ( f addr -- ) <floating> say: "eff-store" Store the floating point number, f, at address, addr.
  220.  
  221. F* ( f1 f2 -- f1*f2 ) <floating> say: "eff-times" Multiply f1 by f2 returning the product to the stack.
  222.  
  223. F+ ( f1 f2 -- f1+f2 ) <floating> say: "eff-plus" Add f1 to f2 returning the sum.
  224.  
  225. F, ( f -- ) <floating> say: "eff-comma" Enclose a floating point number from the stack to the dictionary.
  226.  
  227. F- ( f1 f2 -- f1-f2 ) <floating> say: "eff-minus" Subtract f2 from f1.
  228.  
  229. F. ( f -- ) <floating> say: "eff-dot" Output a floating point number from the stack. Infinities and NAN codes are supported. See "sci" and "fix".
  230.  
  231. F/ ( f1 f2 -- f1/f2 ) <floating> say: "eff-slash' divide f1 by f2.
  232.  
  233. F>D ( f -- d ) <floating> say: "eff-to-dee" Convert a floating point number on the stack to a double number.
  234.  
  235. F@ ( addr -- f ) <floating> say: "eff-at" Fetch the floating point number from an address in memory.
  236.  
  237. FATN ( f -- atn[f] ) <floating> say: "eff-ay-tee-en" Return the arctangent, in radians, of a floating point number. (1 radian = 57.2957795131 degrees)
  238.  
  239. FCOMPARE ( f1 f2 -- f1 f2 flag ) <floating> say: "eff-compare" A non-destructive comparison, returns a flag that depends on the relative values of f1 and f2.  If f1>f2 the flag is +1, if f1<f2 the flag is -1.  If f1=f2 exactly, the flag is zero.  Notice that f1 and f2 are unchanged, and left on the stack.
  240.  
  241. FCOS ( f -- cos[f] ) <floating> say: "eff-cos" Return the cosine of a floating point angle expressed in radians. (1 radian = 57.2957795131 degrees)
  242.  
  243. FDROP ( f -- ) <floating> say: "eff-drop" Remove the top floating point value from the top of the stack.
  244.  
  245. FDUP ( f -- f  f ) <floating> say: "eff-dup" Duplicate the floating point value on the top of the stack.
  246.  
  247. FEXP ( f -- e^f ) <floating> say: "eff-eksp" Return the value of Euler's number raised to the power of a floating point number. (e = 2.71828182846 )
  248.  
  249. FILL ( addr count char -- )  <standard>   Places 'count' characters of 'char' at the relative address, 'addr'.
  250.  
  251. FINT ( f -- int[f] ) <floating> say "eff-int" Return the whole number part of a floating point number.
  252.  
  253. FIX ( n -- ) <floating> Set floating point output to decimal fractions with n digits to the right of the decimal point. See "sci" and "f.".
  254.  
  255. FLITERAL ( comp: f -- | exec: -- f ) <floating> say: "eff-literal" Compile the code to push the value of a floating point number at runtime. Floating point literals are twenty (20) bytes in length. If a number is used more than once it is more efficient to use a constant; see "fconstant".
  256.  
  257. FLN ( f1 -- ln[f1] ) <floating> say: "eff-ell-en" Return the natural logarithm of a floating point number. (base = e = 2.71828182846 )
  258.  
  259. FNUMBER ( dabs.addr -- f ) <floating> say: "eff-number" Convert a character string located at the absolute address on the stack to a floating point number. Infinities and NAN codes are supported.
  260.  
  261. FORGET ( -- )  <standard>   Searches the dictionary for the next token from the input stream.  If found, that word and all subsequent words are removed from the dictionary.
  262.  
  263. FPACK ( fn..f1 fnew m -- fn..f1 :: fm = fnew ) <floating> say: "eff-pack" Place the floating point number, fnew, into the 'm-th' position on the stack. The floating point value, fnew, and the index, m, are removed from the stack.
  264.  
  265. FPICK ( fn..f1 m|n≥m≥1 -- fn..f1 fm ) <floating> say: "eff-pick" Duplicate the 'm-th' floating point value to the top of the stack.
  266.  
  267. FREM ( f1 f2 -- rem[f1/f2] ) <floating> say: "eff-rem" Return the remander of f1 divided by f2.
  268.  
  269. FROLL ( fn..f1 m -- fn..fm+1 fm-1..f1 fm ) <floating> say: "froll" Roll the 'm-th' floating point number to the top of the stack, shifting the numbers between position 1 and position m ten bytes up.
  270.  
  271. FSIN ( f -- sin[f] ) <floating> say: "eff-sign" Return the sine of a floating point angle expressed in radians. (1 radian = 57.2957795131 degrees)
  272.  
  273. FSQRT ( f -- sqrt[f] ) <floating> say: "eff-squirt" Return the square root of a floating point number.
  274.  
  275. FSWAP ( f1 f2 -- f2 f1 ) <floating> say: "eff-swap" Exchange the position of the two top most floating point values on the stack.
  276.  
  277. FTAN ( f -- tan[f] ) <floating> say: "eff-tan" Return the tangent of a floating point angle expressed in radians. (1 radian = 57.2957795131 degrees)
  278.  
  279. FVARIABLE ( compile: -- ) ( run: -- addr ) <floating> say: "eff-variable" Create a ten byte variable for storing floating point numbers.
  280.  
  281. F^ ( f1 f2 -- f1^f2 ) <floating> say: "eff-to-the" Return the value of f1 raised to the power of f2.
  282.  
  283. GROW ( n -- ) <DA only> Adjust the dictionary allocation by n (modulo 32K) bytes. If n is negative, the allocation is diminished.
  284.  
  285. HEADER ( -- )   "Header" builds a name and link field for a new word at "here".
  286.  
  287. HERE ( -- addr )  <standard>   "Here" is the relative address of the start of free memory.
  288.  
  289. HEX ( -- )  <standard>   "Hex" sets the current number base to sixteen.
  290.  
  291. HOLD ( c -- )  <standard>  Insert the character on the stack into the number being converted to a string.  Use between "greater-than-sharp" and "sharp-less-than".
  292.  
  293. IF ( flag -- )  <standard>   Used with "else" and "then" to branch conditionally.  A true flag causes the words following "if" and before "then" (or "else") to be executed.  "If" is an immediate word and is used within a colon definition.
  294.  
  295. ID. ( addr -- ) say: "eye-dee-dot"  <standard>   Print the name of the word whose address is on the stack. Undefined characters are represented by an ellipsis.
  296.  
  297. IMMEDIATE ( -- )  <standard>   "Immediate" is used after a definition, to flag the word as 'immediate' so that is it will execute within a colon definition, rather than being compiled into the definition.  "Immediate" sets bit seven of the name length byte of the last word defined.
  298.  
  299. INTERPRET ( -- ) <standard>   Begin interpreting the contents of the input buffer.
  300.  
  301. KEY ( -- n )  <standard>   Waits for a character to be typed, echoes the character to the screen, advances the cursor and returns the ASCII code on the stack.  Events are handled during the wait.
  302.  
  303. L! ( n daddr32 -- ) say: "el-store"   Store the value of n at the absolute address on the stack.
  304.  
  305. L@ ( daddr32 -- n ) say: "lat" or "el-at"   Retrieve the value found at the absolute address on the stack.
  306.  
  307. LATEST ( -- name.addr )  <standard>   Return the name address of the last word defined.  Latest is used by "search" to find the end of the dictionary.
  308.  
  309. LEAVE ( -- )  <standard>   Causes a premature exit from a "do", "loop" (or "+loop") construct by setting the loop index equal to the loop limit.  Use only within a definite loop structure.
  310.  
  311. LITERAL compiling: ( n -- )  executing: ( -- n )  <standard>   "Literal" compiles a number from the stack to the dictionary.  When a word containing a literal is executed, "literal" pushes the number onto the stack.
  312.  
  313. LOOP compiling: ( addr -- )  executing: ( -- ) <standard>   "Loop" is an immediate word used to terminate a "do" … "loop" construction, in a colon definition.  Branch to the beginning of the loop if the index is less than the limit.  (see "+loop" and "do")
  314.  
  315. M/MOD ( numer32 denom16 -- rem16 quot32 ) say: "em-slash-mod"  <standard>   Divide a double number by a single number leaving a single remainder and a double quotient.
  316.  
  317. MACRO ( -- ) A word is flagged as a macro definition by following the word's definition with the word "macro".  Macro definitions compile their code field inline rather than compiling a subroutine call.  "Macro" sets bit six of the name length byte of the last word defined.  (see "mcompile" and "immediate" )
  318.  
  319. MAX ( n1 n2 -- n )  <standard>   Returns the larger of the two top numbers on the stack.
  320.  
  321. MCOMPILE ( addr -- ) "Mcompile" writes the code field found at the address on the stack.  An RTS instruction signals the end of the routine and compilation stops.  "Mcompile" compiles any word's code field.
  322.  
  323. MIN ( n1 n2 -- n )  <standard>   Returns the smaller of the top two numbers on the stack.
  324.  
  325. MOD ( n1 n2 -- remainder ) say: "mod"  <standard>   Returns the remainder (but not the quotient) of 'n1' divided by 'n2'.
  326.  
  327. MON ( -- )   Causes a monitor such as TMON or MacsBug to activate via the  _Debugger trap. Execution will continue upon exit from the monitor.
  328.  
  329. NEGATE ( n -- -n )  <standard>   Leave the result of zero minus n on the stack.
  330.  
  331. NULL ( -- )   This is a no operation word.
  332.  
  333. NUMBER ( addr -- n t  OR  f )  <standard>   "Number" attempts to convert the string at addr to a value according to the current number base.  If the conversion is successful (that is, if all characters are numerals) the value and a true flag are left on the stack.  Failure leaves only a false flag on the stack.  Unlike FORTH's NUMBER, "number" does not convert double length numbers.
  334.  
  335. OPEN ( -- ) "Open" displays the standard file dialog that allows you to select a file to be interpreted.  Unlike "-->", this does not require the path to be specified.  (see "load next file")
  336.  
  337. OR ( n1 n2 -- n1ORn2 )  <standard>   Leave the result of n1 OR n1 on the stack.  The value is computed bitwise.
  338.  
  339. OVER ( n1 n2 -- n1 n2 n1 )  <standard>   "Over" duplicates the second number on the stack to the top of the stack.
  340.  
  341. PAD ( -- addr )  <standard>   Leave the address of a scratch pad for numeric conversion.  The pad is used downward in memory.  The address of "pad" is 40 bytes beyond "here".
  342.  
  343. PAGE ( -- )  <standard>   "Page" is from the days of mechanical Teletype terminals but is still used.  It clears the window and moves the cursor to the upper left hand corner.
  344.  
  345. PMODE ( mode -- ) say: "pea-mode"   Set the drawing transfer mode of the pen.
  346.  
  347. QUIT ( -- )  <standard>   "Quit" stops executing and returns to the input loop with no message. (see "abort")
  348.  
  349. R ( -- n ) say: "are"  <standard>   "Are" puts the top 16 bit number of the return stack onto the (parameter) stack. The return stack is unaffected.  During the execution of a definite loop ("do" … "loop") the index is kept on the top of the return stack.  "Are" is used to retrieve the value of the index within these loops. (see "to-are", "are-from", "do", "loop" and "plus-loop")
  350.  
  351. R0@ ( -- dabs.addr ) say: "are-naught-at"   Return the absolute address of the bottom of the return stack.
  352.  
  353. R> ( -- n )  return stack: ( n -- ) say: "are-from"  <standard>   "Are-from" gets a number off the return stack and puts it on the parameter stack.  (see "to-are" and "are")
  354.  
  355. REPEAT while compiling: ( addr1 addr2 -- )  while executing: ( -- )  <standard>   "Repeat" is an immediate word, used within a colon definition to terminate a "begin" …"while", … "repeat" indefinite loop.  At runtime "repeat" branches unconditionally to the word following "begin" (at addr1).  (see "begin" and "while")
  356.  
  357. ROOM ( -- bytes ) "Room" leaves the bytes of headroom above "here" on the stack.  Addresses beyond the headroom should not be written to, even if they are addressable, because they may be used by the system.
  358.  
  359. ROT ( n1 n2 n3 -- n2 n3 n1 ) say: "rote"  <standard>   "Rot" brings the third stack item to the top of the stack.
  360.  
  361. RP@ ( -- dabs.addr ) say: "are-pea-at"  Return the absolute address of the top of the return stack.
  362.  
  363. S0@ ( -- dabs.addr ) say: "ess-naught-at"  Return the absolute address of the bottom of the parameter stack.
  364.  
  365. S>D ( n -- d ) say: "ess-to-dee"   Make a single number on the stack into a double number using sign extension.
  366.  
  367. SAVE ( -- )   "Save" writes the dictionary to the disk.  All pertinent data, such as headroom size, the values of variables, etc. are also saved.
  368.  
  369. SCI ( n -- ) <floating> say: "sigh" Set floating point output to scientific notation with n significant digits. See 'fix' and 'f.'.
  370.  
  371. SEARCH ( addr -- addr t OR f )   "Search" looks for the next token from the input stream in the dictionary, starting with the word whose name address is on the stack.  If found, its address and a true flag (minus one) are returned. If the search fails, a false flag (zero) is left on the stack.
  372.  
  373. SIGN ( n d -- d )  <standard>   If the single number is negative, place a negative sign into the conversion "pad".  Use between "greater-than-sharp" and "sharp-less-than".
  374.  
  375. SP@ ( -- dabs.addr ) say: "ess-pea-at" <standard>  Return the absolute address of the top of the parameter stack before the address is put on it.
  376.  
  377. SPACE ( -- ) <standard>   "Space" prints a space character.
  378.  
  379. SWAP ( n1 n2 -- n2 n1 )  <standard>   "Swap" exchanges the top two numbers on the stack.
  380.  
  381. TASK ( -- )   "Task" is a no operation word which marks the end of the dictionary.  The added part of the dictionary can be removed by executing:  FORGET TASK    : TASK ;
  382.  
  383. THEN while compiling: ( addr -- )  while executing: ( -- )  <standard>   "Then" is an immediate word which terminates an "if", ("else"), "then" construction within a colon definition. (see "if" and "then")
  384.  
  385. TIB ( -- addr ) say: "tib" (rhymes with rib)  <standard>   "Tib" returns the relative address of the terminal input buffer. The buffer is an 82 byte data area below the dictionary.  The input stream usually points to a byte within "tib".
  386.  
  387. TOKEN ( -- )   "Token" moves the next word from the input stream to "here", the end of the dictionary.
  388.  
  389. TYPE ( addr n -- ) <standard>   "Type" prints n number of characters from memory starting at the relative address, addr.  For best results addr should contain at least n ASCII characters.
  390.  
  391. U. ( n -- ) say: "you-dot"  <standard>   Print the value of n in the current numeric base as an unsigned number.
  392.  
  393. U* ( n1 n2 -- d[n1*n2] ) say: "you-star"  <standard>   "You-star" multiplies two unsigned 16 bit numbers from the stack and leaves a double number product on the stack.
  394.  
  395. UNTIL ( flag -- )  <standard>   "Unitl" is an immediate word used with in a colon definition after "begin" to conditionally terminate an indefinite loop.  If flag is true execution passes to the next word.  If false it branches back to the word following "begin".   (see "begin" and "back")
  396.  
  397. UPPER ( addr -- ) Given a string's address on the stack, "upper" converts lower case to upper case.  The first byte must contain the length of the string.
  398.  
  399. VARIABLE compiling: ( -- ) executing: ( -- addr )  <standard>   "Variable" creates a word from the next word in the input stream, and reserves one cell (two bytes) of data.  When the new word is executed, it leaves the relative address of the data cell on the stack.   Words created with "variable" are four byte macros.
  400.  
  401. WARM ( -- ) <standard> "Warm" restarts the Pocket Forth application as if it had been rebooted, except changes to the dictionary are kept.
  402.  
  403. WHAZAT ( -- ) say: "what-is-that"   "Whazat" prints the current token from the input stream, and executes "abort", if the current token was not found in the dictionary.
  404.  
  405. WHILE ( flag -- )  <standard>   "While" is an immediate word used within a colon definition, between "begin" and "repeat" to control an indefinite loop with an exit in the middle.  If the flag is true, the words after "while" and before "repeat" are executed, if the flag is false, execution jumps to the word following "repeat". (see "begin" and "repeat".)
  406.  
  407. WORD ( c -- )  <standard>   "Word" moves the next token, delimited by the character on the stack, from the input stream  to "here", the end of the dictionary.
  408.  
  409. WORDS ( -- )  <standard>   "Words" prints all of the words in the dictionary.
  410.  
  411. XOR ( n1 n2 -- ) <standard> say: "zor" or "eks-or"   Leave the result of a bitwise exclusive or of n1 and n2 on the stack.
  412.  
  413. [ ( -- ) say: "left-bracket"  <standard>   "Left-bracket" sets the interpreter into immediate mode.  Words following "left-bracket" are executed rather than compiled.  "Left-bracket" is an immediate word.
  414.  
  415. [COMPILE] ( -- ) say: "bracket-compile"  <standard>   "Bracket-compile" is an immediate word used within a colon definition to compile the following immediate word from the input stream into the current definition.
  416.  
  417. \ ( -- ) say "back slash"  <standard>   "Back slash" causes the rest of the line to be ignored. Used for commenting. "Back slash" is an immediate word.
  418.  
  419. ] ( -- ) say: "right-bracket"  <standard>   "Right-bracket" puts the interpreter into compile mode so that subsequent non-immediate words will be compiled to the dictionary.  "Right-bracket" is an immediate word.
  420.  
  421. "{cr}" ( -- ) say: ""   When the token consisting of an ascii 13 is executed, the return stack is reset, and the input sequence is restarted.  This is an immediate word.  Do not confuse this word with "cr".
  422.  
  423. "{null}" ( -- ) say: "" <standard>   This is an alias for "{cr}" to assure that "expect"ed text, which is terminated by a null (zero byte), and pasted text are treated the same.  This is an immediate word.
  424.